package AllDay;

import java.util.Arrays;

public class Day05missingNumber {
    public static int missingNumber(int[] nums){
        if(nums.length==0&nums==null) return -1;
        int N = nums.length;
        int L = 0;
        int R = N-1;
        while (L <= R){
            int mid = (L+R)/2;
            if(mid == nums[mid]) {
                L = mid+1;
            }else {
                R = mid-1;
            }
        }
        return L;
    }

}
